home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
keyb
/
kbscan.zip
/
KBSCAN.DOC
< prev
next >
Wrap
Text File
|
1988-01-15
|
603b
|
32 lines
/*
* Keyboard test program
*/
#include <dos.h>
int main(argc, argv)
int argc;
char **argv;
{
union REGS regs;
printf ("Keyboard test (use Esc to exit)\n\n");
for (;;)
{
regs.h.ah = 0;
int86 (0x16, ®s, ®s);
if ( regs.h.al )
{
printf ("Normal key, scancode: %3d(dec), %2x(hex) ",
regs.h.ah, regs.h.ah);
printf (" Value: %3d(dec), %2x(hex), Ascii:%c\n",
regs.h.al, regs.h.al, regs.h.al);
if ( regs.h.al == 033 )
break;
}
else
printf ("Extended key, scancode: %3d(dec), %2x(hex)\n",
regs.h.ah, regs.h.ah);
}
}